package com.iplant.wms.service.basicenum.asn;

import com.iplant.base.po.enums.BaseEnum;

public enum WMSReceiveType implements BaseEnum {
	/**
	 * 默认
	 */
	Default(0, "默认"),

	/**
	 * 直接收货
	 */
	General(101, "直接收货"),
	/**
	 * 待收货
	 */
	Notice(102, "通知单收货"),
	/**
	 * 采购收货
	 */
	Purchase(103, "采购收货"),
	/**
	 * 生产收货
	 */
	Product(104, "生产收货") ;

	private int value;
	private String label;
	private String remark;

	private WMSReceiveType(int value, String label) {
		this.value = value;
		this.label = label;
	}

	@Override
	public void setValue(int value) {
		this.value = value;
	}

	@Override
	public int getValue() {
		return this.value ;
	}

	@Override
	public String getLabel() {
		return label;
	}

	@Override
	public void setLabel(String label) {
		this.label = label;
	}

	@Override
	public String getRemark() {
		return remark;
	}

	@Override
	public void setRemark(String remark) {
		this.remark = remark;
	}

	/**
	 * 通过 value 的数值获取枚举实例
	 *
	 * @param val
	 * @return
	 */
	public static WMSReceiveType getEnumType(int val) {
		for (WMSReceiveType type : WMSReceiveType.values()) {
			if (type.getValue() == val) {
				return type;
			}
		}
		return Default;
	}

	public static WMSReceiveType getEnumType(String val) {
		for (WMSReceiveType type : WMSReceiveType.values()) {
			if (type.getLabel().equals(val)) {
				return type;
			}
		}
		return Default;
	}

}